<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
 <%@ page isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<link rel="stylesheet" type="text/css" href="../css/aui.css" />
		<style>
			#header {
				font-size: 17px;
			}
		</style>
	</head>
	<body>
		<header class="aui-bar aui-bar-nav" id="header">
			首页
		</header>
		<div id="body">
		</div>
		<footer class="aui-bar aui-bar-tab" id="footer" >
			<div class="aui-bar-tab-item aui-active" onclick="openFrm('frame_news','资讯')" id="work">
				<i class="aui-iconfont aui-icon-home"></i>
				<div class="aui-bar-tab-label">
					资讯
				</div>
			</div>
			<div class="aui-bar-tab-item"  onclick="openFrm('frame_product','产品')" id="customer">
				<i class="aui-iconfont aui-icon-cert"></i>
				<div class="aui-bar-tab-label" id="cust">
					产品
				</div>
			</div>
			<div class="aui-bar-tab-item"  onclick="openFrm('frame_serviceSupport','服务支持')" id="contract">
				<i class="aui-iconfont aui-icon-calendar"></i>
				<div class="aui-bar-tab-label">
					服务支持
				</div>
			</div>
			<div class="aui-bar-tab-item"  onclick="openFrm('frame_myCustomer','我的')" id="my">
				<i class="aui-iconfont aui-icon-my"></i>
				<div class="aui-bar-tab-label">
					我的
				</div>
			</div>
		</footer>
	</body>
	<script type="text/javascript"  src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
	<script type="text/javascript"  src="${pageContext.request.contextPath}/js/aui-search.js"></script>
	<script type="text/javascript">
		
		
		 if(getCookie('waplast_url') == ""||getCookie('waplast_url') == null)
		{
			$("#body").load("${pageContext.request.contextPath}/wap/frame_news.do");
			$("#header").html("首页");
		}
		else
		{
			$("#body").load("${pageContext.request.contextPath}/wap/"+getCookie('waplast_url')+".do");
			$("#header").html(getCookie('waplast_title'));
			$(".aui-bar-tab-item").removeClass("aui-active");
			$(".aui-bar-tab-item").eq(getCookie('waplast_index')).addClass("aui-active");
		}
			
		function openFrm(windows,title)
		{
			setCookie("waplast_url",windows);
			setCookie("waplast_title",title);
			$("#body").load("${pageContext.request.contextPath}/wap/"+windows+".do");
			$("#header").html(title);
		}
		
		$(".aui-bar-tab-item").click(function(){
			$(".aui-bar-tab-item").removeClass("aui-active");
			$(this).addClass("aui-active");
			setCookie("waplast_index",($(this).index()));
		});
		
		
		
		function setCookie(c_name,value,expiredays)
		{
			var exdate=new Date()
			exdate.setDate(exdate.getDate()+expiredays)
			document.cookie=c_name+ "=" +escape(value)+
			((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
		}
		
		function getCookie(c_name)
		{
		if (document.cookie.length>0)
		  {
		  c_start=document.cookie.indexOf(c_name + "=")
		  if (c_start!=-1)
		    { 
		    c_start=c_start + c_name.length+1 
		    c_end=document.cookie.indexOf(";",c_start)
		    if (c_end==-1) c_end=document.cookie.length
		    return unescape(document.cookie.substring(c_start,c_end))
		    } 
		  }
		return ""
		}
		
	</script>
</html>